home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / e / amigae21b.lha / Amiga_E_v2.1b / Docs / Utility.doc < prev    next >
Text File  |  1992-09-02  |  16KB  |  519 lines

  1.         +-----------------------------------------------+
  2.         |                        |
  3.         |                 Amiga E v2.1b                 |
  4.         |          Compiler for The E Language          |
  5.         |           By Wouter van Oortmerssen           |
  6.         |                        |
  7.          |                 Utility.doc                   |
  8.         |                        |
  9.         +-----------------------------------------------+
  10.  
  11.  
  12. This document describes the functioning of the programs in the
  13. sources/ directory, and most important: the utilities found there.
  14. All of these programs are suplied in the form of an E-sourcecode,
  15. some also as executable (while being part of the compiler support
  16. utilities, rather than an example source)
  17.  
  18. NOTE: the bigger programs in the Sources/Other and Sources/Projects
  19.       directory have separate docs in the Docs/Utilities dir,
  20.       others just have no documentation at all.
  21.  
  22. contents:     Utilities/ShowModule.e
  23.             ShowHunk.e
  24.             ShowChunk.e
  25.             Iconvert.e
  26.             Pragma2Module.e
  27.             DirQuick.e
  28.             D.e
  29.             Watch.e
  30.             Mem.e
  31.             QuickLaunch.e
  32.             SuperVisor.e
  33.             Nkript.e
  34.  
  35.                    /Bin/ecompile.rexx
  36.  
  37.                Examples/GadToolDemo.e
  38.             AppMenuItem.e
  39.             Req.e
  40.             Reqtools.e
  41.             Asl.e
  42.             Ereq.e
  43.             GetArgs.e
  44.             WbArg.e
  45.             ReadArgs.e
  46.             Helloworld.e
  47.             Shell.e
  48.             Colourscreen.e
  49.             24bitColourDemo.e
  50.  
  51.                   Other/Pyth.e
  52.             Avail.e
  53.             Draw.e
  54.             Vd.e
  55.             Talk.e
  56.  
  57.                Projects/Forth.e
  58.             Pi.e
  59.             RewriteGfx.e
  60.             Yax.e
  61.  
  62.  
  63. +---------------------------------------+
  64. |    SHOWMODULE.E            |
  65. +---------------------------------------+
  66. sources/utilities/showmodule.e, bin/showmodule
  67.  
  68. As you might have noticed, E's equivalent for "includes", modules,
  69. are binary files, much like those usually suplied with Modula2
  70. compilers, for example. To display the contents of such a file
  71. in readable ascii form, you may use showmodule:
  72.  
  73. showmodule <modulespec>
  74.  
  75. examples:
  76.  
  77. 1> showmodule emodules:intuition/intuition.m
  78. 1> showmodule >gadtools.txt emodules:gadtools.m
  79.  
  80. note that showmodule by default outputs to the console,
  81. and may be interrupted at any point by <ctrlc>.
  82.  
  83.  
  84. +---------------------------------------+
  85. |    SHOWHUNK.E            |
  86. +---------------------------------------+
  87. sources/utilities/showhunk.e, bin/showhunk
  88.  
  89. Displays all types of executable files, and also object ".o"
  90. files as generated by (other) compilers/assemblers.
  91. will show you the (very simple) structure of executables generated
  92. by EC, but also support complex overlay-files. also dumps
  93. labels (like XREF's and XDEF's)
  94.  
  95. showhunk <exefile>
  96.  
  97. like:   1> showhunk helloworld
  98.         1> showhunk dpaint
  99.  
  100.  
  101. +---------------------------------------+
  102. |    SHOWCHUNK.E            |
  103. +---------------------------------------+
  104. sources/utilities/showchunk.e
  105.  
  106. shows the inner structure of all types of IFF files. does not
  107. display or play anything, but reports on a great number of chunks.
  108. this way you may find out how some animation is build up, or who
  109. is the author of a certain SMUS masterpiece.
  110. supports ILBM, ANIM, SMUS, 8SVX, FTXT, PREF, MDBI for now.
  111.  
  112. showchunk <ifffile>
  113.  
  114. 1> showchunk mypic.iff
  115.  
  116.  
  117. +---------------------------------------+
  118. |    ICONVERT.E            |
  119. |    PRAGMA2MODULE.E            |
  120. +---------------------------------------+
  121. sources/utilities/iconvert.e, bin/iconvert
  122. sources/utilities/pragma2module.e, bin/pragma2module
  123.  
  124. These two utilities are for advanced E-programmers only. if
  125. you don't feel like one (yet), skip this part.
  126.  
  127. Iconvert will convert structure and constant definitions in
  128. assembly ".i" files to E modules, and pragma2module will do the
  129. same for SAS/C pragma library definition files. ofcourse, all
  130. commodores includes have already been converted this way, but
  131. say you find a nice PD library that you may want to use with E,
  132. you will need these utilities.
  133.  
  134. most libraries come with various includes defining, most obvious,
  135. the library calls of the library, as well as the constants
  136. and structures (OBJECTs in E) that it uses. say that it is
  137. called "tools.library", then it will probably feature:
  138.  
  139. pragmas/tools_pragmas.h
  140. includes/tools.h
  141. includes/tools.i
  142.  
  143. then do:
  144.  
  145. 1> pragma2module tools_pragmas.h
  146.  
  147. rename the resulting "tools_pragmas.m" to "tools.m" and put it
  148. in emodules:, check with ShowModule if all went well.
  149.  
  150. Now, in your program you may use tools.library:
  151.  
  152. MODULE 'tools'
  153.  
  154. PROC main()
  155.   IF (toolsbase:=Openlibrary('tools.library',37))=NIL THEN error()
  156.  
  157.   toolsfunc()
  158.  
  159. ...etc.
  160.  
  161. convert tools.i with Iconvert to another tools.m, which you place in
  162. emodules:libraries, for example. Iconvert needs an assembler like
  163. the PD A68k to do the hard work of understanding the actual assembly.
  164.  
  165. 1> iconvert tools.i
  166.  
  167. see with showmodule what became of the ".i" file. use in your
  168. program with:
  169.  
  170. MODULE 'libraries/tools'
  171.  
  172. DEF x:toolsobj, y=TOOLS_CONST
  173.  
  174. converting with Iconvert may require some assembly expertise, as
  175. Iconvert relies on the correct format of the ".i" file, just like
  176. commodores assembly includes. About 10% of the ".i" files need
  177. to be patched by hand to be "convertable". definitions that
  178. Iconvert judges correctly are amongst others
  179.  
  180. <label> EQU <any_expression>
  181.  
  182. STRUCTURE <sname>,0      ; if <>0, then   <struct>_SIZEOF
  183. ULONG <sname>_<label>
  184. BPTR <sname>_<label>
  185.    ; etc.
  186. LABEL <sname>_SIZEOF     ; or "_SIZE"
  187.  
  188. to get an idea what kind of assembly-expression Iconvert can
  189. handle, take a peek in the source code.
  190.  
  191.  
  192. +---------------------------------------+
  193. |    DIRQUICK.E            |
  194. +---------------------------------------+
  195. sources/utilities/dirquick.e
  196.  
  197. Very small directory lister, the little brother of D.e.
  198. does nothing fancy, but is a nice short example
  199. works with os v33
  200.  
  201.  
  202. +---------------------------------------+
  203. |    D.E                |
  204. +---------------------------------------+
  205. sources/utilities/d.e, bin/d, needs v37
  206.  
  207. Universal directory lister suplied with Amiga E. called with no
  208. arguments, by just typing "d", it lists the current directory.
  209. template:
  210.  
  211. DIR,REC/S,COL/K/N,SIZE/S,NOSORT/S,NOFILES/S,NODIRS/S,FULL/S,NOANSI/S,
  212. TARGET/K,DO/K/F
  213.  
  214. DIR        specifies an optional path to the dir you wish to list.
  215.         may contain standard wildcard patterns like #?~[]%() etc.
  216. REC        specifies that subdirectories should be listed recursively.
  217. COL <num>    where n=1..3, by default, D list dirs in three columns to
  218.         keep all nice and compact. specify 1 or 2 if you like.
  219. SIZE        reports the size of each dir as it is being listed. note that
  220.         combined with REC gives sizes of whole dir (sub-)trees.
  221. NOSORT        by default, dirs are sorted before display. disable this with
  222.         the NOSORT switch.
  223. NOFILES        displays just dirs
  224. NODIRS        displays just files
  225. FULL        lists full path instead of just filename
  226. NOANSI        doesn't use ansi display codes while printing
  227. TARGET <dir>    specifies a target directory for use with DO. should
  228.         end in either "/" or ":"
  229. DO <comline>    specifies a commandline for automatic script generation.
  230.         note that this uses up the rest of D's commandline.
  231.  
  232. something should be said on the script feature: it enables you
  233. to perform repetitive tasks on whole dirs, or dir-trees. existing
  234. utilities that enabled you to do such tasks where mostly not
  235. flexible enough; d enables you to use the REC keyword in combination
  236. with scripts, allows for variable extensions: use <file>.o if
  237. the original name was <file>.s, and the spec. of a target:
  238. resulting files from the operation are placed in another dir, which
  239. can be a complete mirror image of another dir-tree. makedir
  240. statements are inserted if target: is empty.
  241.  
  242. following format codes may be used in <commandline>:
  243.  
  244. %s is file (filename+path)
  245. %f is file WITHOUT extension
  246. %r is file without extension, but with leading <dir> replaced by
  247.    <target> (usefull if <commandline> allows for an outputfile)
  248. %> or %< %>> etc. prevents the shell from thinking ">" is a redirection
  249.    for D, instead of <commandline>
  250.  
  251. a complex example:
  252. you wish to have a complete ascii reference of the emodules:
  253. directory, recursively, and with the resulting .txt files
  254. as a mirror-image directory structure somewhere else.
  255.  
  256. 1> D >ram:script emodules: REC TARGET=t:mods/ DO showmodule %>%r.txt %s
  257. 1> execute ram:script
  258.  
  259. will do that for you.
  260. for any file like "emodules:exec/io.m" D will make a line like:
  261. "showmodule  >t:mods/exec/io.txt emodules:exec/io.m"
  262.  
  263. other examples:    D >mydirlist dh0: COL=2 SIZE REC NOANSI
  264.         D docs: DO type >prt: %s
  265.         D asm: TARGET=obj: DO genam %s -o%r.o
  266.  
  267.  
  268. +---------------------------------------+
  269. |    WATCH.E                |
  270. +---------------------------------------+
  271. sources/utilities/watch.e, needs v37
  272.  
  273. simply "watches" a file, using the new notification system
  274. of kick2.0. note: does not _prevent_ files from being modified,
  275. just tells you. usefull, for example, if you're installing a new
  276. software package, and you want to know wether the installer
  277. does something funny to your startup-sequence or user-startup.
  278.  
  279. 1> run watch s:startup-sequence
  280.  
  281. note that the only way to stop watching is asctually modifying
  282. the file. (or rebooting :-)
  283.  
  284.  
  285. +---------------------------------------+
  286. |    MEM.E                |
  287. +---------------------------------------+
  288. sources/utilities/mem.e
  289.  
  290. simply dumps memory in a shell, usefull for hardcore-kamikaze
  291. debugging and the like.
  292.  
  293. try:
  294. 1> mem $f80000        ; only if you have a non-moved kick2.0 or better
  295.  
  296.  
  297. +---------------------------------------+
  298. |    QUICKLAUNCH.E            |
  299. +---------------------------------------+
  300. sources/utilities/quicklaunch.e
  301.  
  302. Pops up a window with gadgets named after utils mentioned in a
  303. text file, to be able to launch them. Allows for the control of
  304. outputwindows when run from workbench.
  305. Needs textfile named "s:quicklaunch.config" to know what to run.
  306. format: odd lines = names, even = path of utils. be sure
  307. to add exactly one last <return>
  308.  
  309.  
  310. +---------------------------------------+
  311. |    SUPERVISOR.E            |
  312. +---------------------------------------+
  313. sources/utilities/supervisor.e
  314.  
  315. A very small system-monitor, displays tasks and the like.
  316. Press different gadgets to see different lists.
  317. Lists are only updated when gadgets are pressed or the
  318. supervisor window is resized.
  319.  
  320.  
  321. +---------------------------------------+
  322. |    NKRIPT.E            |
  323. +---------------------------------------+
  324. sources/utilities/nkript.e
  325.  
  326. Nkript is very simple file (de)coder
  327. USAGE: nkript <file>
  328.  
  329. nkript asks for a 4 letter key, and a 3 letter pincode.
  330. as nkript uses EOR, you may use this program to code and
  331. decode. the key and pincode are not stored anywhere, so it
  332. _relatively_ safe. this has the effect that if you type the
  333. wrong key, no error is given, but the file is simply
  334. decoded wrong.
  335.  
  336.  
  337. +---------------------------------------+
  338. |    ECOMPILE.REXX            |
  339. +---------------------------------------+
  340. /bin/ecompile.rexx
  341.  
  342. As this was the only Arexx script in the distribution, i threw
  343. it in the Bin directory. I hope to be able to include more rexx
  344. scripts in some next release, for other editors
  345.  
  346. This is a rexx-script for CygnusEd (tm), and enables you to
  347. compile E programs from the editor. Just assign this script
  348. a function key in the editor with "Install Dos/Arexx command ..."
  349. (check your CED-manual if you're not sure how to do this).
  350. Now write your programs, and press Fx if you wish to compile.
  351. Your source will be saved if necessary, the compiler will be
  352. invoked on a separate console window, and the program is run
  353. on the same console. When your program is done, you may press
  354. <return> to return to the editor (CED-screen to back and front is
  355. automatically done by the script). If an error occurred during
  356. compilation, the script will let CED jump to the line of
  357. error after you pressed <return>
  358.  
  359. Note: in the script is a path names as to were the compiler
  360. can be found. You probably need to change this. Also, the script
  361. copies EC to ram: for systems with a slower SYS: device, you may
  362. want to disable this if you have a fast HD.
  363.  
  364.  
  365. +---------------------------------------+
  366. |    GADTOOLSDEMO.E            |
  367. |    APPMENUITEM.E            |
  368. +---------------------------------------+
  369. sources/examples/gadtoolsdemo.e
  370. sources/examples/appmenuitem.e
  371.  
  372. Two examples that show nicely how to do 2.0-system-programming
  373. in Amiga E. Especially the extensive use of (typed-)lists
  374. in gadtoolsdemo.e is impressive.
  375.  
  376.  
  377. +---------------------------------------+
  378. |    REQ.E                |
  379. |    REQTOOLS.E            |
  380. |    ASL.E                |
  381. |    EREQ.E                |
  382. +---------------------------------------+
  383. sources/examples/req.e
  384. sources/examples/reqtools.e
  385. sources/examples/asl.e
  386. sources/examples/ereq.e
  387.  
  388. Four examples that show usage of all sorts of requesters from
  389. external libraries and system programming. the first two are
  390. ofcourse about the two famous PD requester libraries, while the
  391. last two demo requester facilities that come with kick2.0
  392.  
  393.  
  394. +---------------------------------------+
  395. |    GETARGS.E            |
  396. |    READARGS.E            |
  397. |    WBARG.E                |
  398. +---------------------------------------+
  399. sources/examples/getargs.e
  400. sources/examples/readargs.e
  401. sources/examples/wbarg.e
  402.  
  403. Three examples that show how to get your args to your programs.
  404. the first two are about commandline args from a shell, the last
  405. about getting args in a workbench environment. of the firts two,
  406. the first is the general example, while the second is 2.0 specific,
  407. using ReadArgs().
  408.  
  409.  
  410. +---------------------------------------+
  411. |    HELLOWORLD.E            |
  412. |    COLOURSCREEN.E            |
  413. |    SHELL.E                |
  414. +---------------------------------------+
  415. sources/examples/helloworld.e
  416. sources/examples/colourscreen.e
  417. sources/examples/shell.e
  418.  
  419. The three simplest, most straight forward examples to start with.
  420. give you a basic impression what E can look like.
  421.  
  422.  
  423. +---------------------------------------+
  424. |    24BITCOLOURDEMO.E        |
  425. +---------------------------------------+
  426. sources/examples/24bitcolourdemo.e
  427.  
  428. A small demo demonstrating the new 24bit palette of the newer AA
  429. Amigas. You'll need such an amiga and kick3 to run this demo, ofcourse.
  430. The demo will draw lines in 256 tints and less on the screen, and then
  431. lets you manipulate the colour-registers by pressing the leftMB on some
  432. (x,y) spot on the screen. These coordinates will serve as RGB values.
  433. To quit, press the rightMB.
  434.  
  435.  
  436. +---------------------------------------+
  437. |    PYTH.E                |
  438. +---------------------------------------+
  439. sources/other/pyth.e
  440.  
  441. An example variable-depth pythagoras tree generating program
  442. written by Raymond Hoving. Uses "reqtools.library".
  443.  
  444.  
  445. +---------------------------------------+
  446. |    AVAIL.E                |
  447. |    DRAW.E                |
  448. |    VD.E                |
  449. +---------------------------------------+
  450. sources/other/avail.e
  451. sources/other/draw.e
  452. sources/other/vd.e
  453.  
  454. Three little examples written by Erwin van Breemen, including
  455. an avail replacement, an image-processing package :-), and a
  456. vector checker.
  457.  
  458.  
  459. +---------------------------------------+
  460. |    TALK.E                |
  461. +---------------------------------------+
  462. sources/other/talk.e
  463.  
  464. A cli command written by Rob Verver that uses the 2.0 narrator.device
  465. to say texts. It allows for setting of _all_ new speech parameters
  466. through command line options.
  467.  
  468.  
  469. +---------------------------------------+
  470. |    FORTH.E                |
  471. +---------------------------------------+
  472. sources/projects/forth.e
  473.  
  474. A _very_ simple forth interpreter. nice example of how easy one
  475. can build interpreters for languages like this. It is far
  476. from a finished forth interpreter, so may be used to see how
  477. forth works, or as a stack-featured calculator.
  478.  
  479.  
  480. +---------------------------------------+
  481. |    PI.E                |
  482. +---------------------------------------+
  483. sources/projects/pi.e
  484.  
  485. A pi calculation program. nothing special except that it is one
  486. of the few program that demonstrate clearly the use of the inline
  487. assembler, and how to interface with E.
  488.  
  489.  
  490. +---------------------------------------+
  491. |    REWRITEGFX.E            |
  492. +---------------------------------------+
  493. sources/projects/rewritegfx.e
  494.  
  495. a graphics plotting system that uses rewrite-grammars. the idea is
  496. that the description of an image (much like some fractals i know)
  497. is denoted in a grammar, which is then used to plot the gfx.
  498. the system uses turtlegraphics for plotting, and some forth-heritage
  499. for additional power. the program is not meant to actually "used";
  500. change to different graphics with the CONST in the sources, to
  501. see what the grammars do.
  502.  
  503.  
  504. +---------------------------------------+
  505. |    YAX.E                |
  506. +---------------------------------------+
  507. sources/projects/yax.e
  508. sources/projects/yaxsrc/#?.yax
  509.  
  510. this is a complete programming language written in E, together with
  511. some example sources. It was written as an experiment to create
  512. a normal procedural programming language that is simpler in
  513. concept and more consistent. In the docs/utilities directory
  514. you'll find the complete doc that I threw together for those of
  515. you who want to explore this language.
  516.  
  517. the directory Sources/Projects/YaxSrc also contain a source
  518. written by someone else, Ypaint by Ben Schaeffer
  519.